package com.zl.smartmall.library.vo;

import java.util.List;

import com.zl.smartmall.library.po.ProvinceInfo;

import net.tsz.afinal.FinalDb;
import android.content.Context;
import android.location.Address;

public class NewAddressDao {
	private static final String TAG = NewAddressDao.class.getSimpleName();
	
	private FinalDb mFinalDb;
	public NewAddressDao(Context context){
		mFinalDb = FinalDb.create(context);
	}
	
	public synchronized void insert(List<ProvinceInfo> list){
		mFinalDb.batchSave(list);
	}
	
	public synchronized List<ProvinceInfo> getProvinceList(){
		List<ProvinceInfo> list = mFinalDb.findAllByWhere(ProvinceInfo.class, "pid=0");
		return list;
	}
	public synchronized List<ProvinceInfo> getListByPid(int pid){
		List<ProvinceInfo> list = mFinalDb.findAllByWhere(ProvinceInfo.class, "pid="+pid);
		return list;
	}
	
}
